//
//  ComposeTitleView.swift
//  weibo
//
//  Created by 叶子韬韬 on 2017/5/7.
//  Copyright © 2017年 叶子韬韬. All rights reserved.
//

import UIKit
import SnapKit
class ComposeTitleView: UIView {


    internal lazy var titleLabel :UILabel = UILabel()
    internal lazy var screenNameLabel :UILabel = UILabel()
    //构造函数
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("false")
    }
    
    
}
// MARK:- #注释>设置ui界面
extension ComposeTitleView{
    internal func setupUI(){
        //将两个label添加到view
        addSubview(titleLabel)
        addSubview(screenNameLabel)
        
        titleLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(self)
            make.top.equalTo(self)
        }
        
        screenNameLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(titleLabel.snp.centerX)
            make.top.equalTo(titleLabel.snp.bottom).offset(3)
        }
        
        //设置内置空间属性
        titleLabel.font = UIFont.systemFont(ofSize: 16)
        screenNameLabel.font = UIFont.systemFont(ofSize: 14)
        screenNameLabel.textColor = UIColor.gray
        titleLabel.text = "发微博"
        screenNameLabel.text = UserAccoutViewModel.shareInstance.account?.screen_name
        
        
        
    }
}
